<template>
  <common-crud ref="CommonCrudTest" :crudOptionProps="crudOptionProps"></common-crud>
</template>

<script>
import commonCrud from "@/components/commonCrud/CommonCrud.vue"
import {baseUrl} from "../../../config/env";

export default {
  name: "gTableInfo",
  components: {commonCrud},
  data() {
    return {
      // 表配置
      crudOptionProps: {
        name: 'generator/gTableInfo',
        apiPrefix: '/generator/gTableInfo',
        // 是否云原生
        // functionTarget: 'gTableInfo',
        tableOption: {
          addBtn: false,
          editBtn: false,
          column: [

            {
              label: "数据源",
              prop: "datasourceId",
              search: true,
              required: false,
              type: 'select',
              dicUrl: baseUrl + "/generator/gDatasource/datasourceList",
            },


            {
              label: "表名",
              prop: "tableName",
              search: true,
              required: false,


            },


            {
              label: "实体类名称",
              prop: "entityName",
              search: false,
              required: false
            },


            {
              label: "表注释",
              prop: "tableComment",
              search: false,
              required: false
            },


            {
              label: "包名称",
              prop: "packageName",
              search: false,
              required: false
            },


            {
              label: "作者",
              prop: "auth",
              search: false,
              required: false
            },


            {
              label: "模块名称",
              prop: "moduleName",
              search: false,
              required: false
            },


          ]
        },
        buttonList: [


          {
            menuType: "menuLeft",
            name: "导入数据库表",
            icon: "el-icon-circle-plus",
            mode: 'dialog',
            component: '../../views/generator/tableinfo/chooseTable',
            info: {

              // 组件标题
              title: ' 导入数据库表',
              //是否初始化init方法
              isInit: true
            }
          },
          {
            menuType: "menu",
            name: "设计",
            icon: "el-icon-circle-plus",
            mode: 'commd',
            component: '../../views/generator/tableinfo/codegenerator',
            info: {
              dialogWidth: "100%",
              // 组件标题
              title: '设计',
              //是否初始化init方法
              isInit: true
            }
          },

          {
            menuType: "menu",
            name: "代码生成",
            icon: "View",
            mode: 'openurl',
            info: {
              url: baseUrl + "/generator/gTableInfo/generator",
              // url中传参
              prop: "id",
              // 是否打开新的页面
              blank: true,
            }

          },
          {
            menuType: "menu",
            name: "代码预览",
            icon: "el-icon-circle-plus",
            mode: 'commd',
            component: '../../views/generator/tableinfo/preview',
            info: {
              dialogWidth: "100%",
              // 组件标题
              title: '代码预览',
              //是否初始化init方法
              isInit: true
            }
          },
          {
            menuType: "menu",
            name: "菜单生成",
            icon: "el-icon-circle-plus",
            mode: 'dialog',
            component: '../../views/generator/tableinfo/createMenu',
            info: {
              // 组件标题
              title: '菜单生成',
              //是否初始化init方法
              isInit: true
            }
          },
        ]
      }

    }
  }, created() {

  }, computed() {

  }, methods: {}
}
</script>

<style scoped>

</style>
